# import initial
# import os
#
#
# def get_person(name):
#     family = initial.get_family()
#     for i in family:
#         if i.name == name:
#             return i
#
#
# def storage_str(person):
#     str1 = ''
#     str1 += person.name + '\n'
#     str1 += person.gender + '\n'
#     str1 += person.birth + '\n'
#     str1 += person.marry + '\n'
#     str1 += person.address + '\n'
#     str1 += person.tel + '\n'
#     str1 += person.qqNum + '\n'
#     str1 += person.email + '\n'
#     str1 += person.father.name + '\n'
#     return str1
#
#
# def modify_factor(person):
#     str1 = storage_str(person)
#     print(str1)
#     factor = input('请输入想要修改的信息\n>>>')
#     info = input('想要修改成\n>>>')
#     if factor == '婚否':
#         person.marry = info
#         print('修改成功')
#     if factor == '住址':
#         person.address = info
#         print('修改成功')
#     if factor == '电话':
#         person.tel = info
#         print('修改成功')
#     if factor == 'QQ':
#         person.qqNum = info
#         print('修改成功')
#     if factor == 'email':
#         person.email = info
#         print('修改成功')
#
#     str2 = storage_str(person)
#     print(str2)
#     with open('backup.txt', 'r', encoding='utf-8') as read_f, open('backup.new.txt', 'w', encoding='utf-8') as write_f:
#         data = read_f.read()
#         print()
#         data = data.replace(str1, str2)
#         write_f.write(data)
#     os.remove('backup.txt')
#     os.rename('backup.new.txt.', 'backup.txt')
#
#
# person = get_person('贾宝玉')
# modify_factor(person)
